Skip to content

Conversation

@Peterson-Brett
Copy link
Contributor

  • Adding SPI PDL driver
  • Adding spi loopback overlays for pse84
  • Adding spi loopback overlays for psc3

@github-actions
Copy link

Hello @Peterson-Brett, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link
Contributor

@tbursztyka tbursztyka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tiny comments, all looks good to me otherwise.


config IFX_CAT1_SPI_DMA
bool "Infineon CAT1 SPI Interrupt Support"
default n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to, it's by default unset.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed 'default n'

cy_cb_scb_spi_handle_events_t spi_handle_events_func;

uint8_t cs_oversample_cnt;
uint8_t cs_oversample[32];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverse the order, and move it at the end of the structure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

uint32_t tx_buffer_size;
bool is_async;
ifx_cat1_event_callback_data_t callback_data;
cy_stc_syspm_callback_t spi_deep_sleep;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-order the attributes so the structure is better aligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I improved the ordering. @tbursztyka, please let me know if you think more should be done here.

CONFIG_SERIAL=y

# Main Stack Size
CONFIG_MAIN_STACK_SIZE=2048
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done at the application level as required

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed.

Comment on lines 10 to 12
#define LOG_LEVEL CONFIG_SPI_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cat1_spi);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define LOG_LEVEL CONFIG_SPI_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cat1_spi);
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cat1_spi, CONFIG_SPI_LOG_LEVEL);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

Comment on lines 16 to 26
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h>
#include <zephyr/dt-bindings/clock/ifx_clock_source_common.h>

#ifdef CONFIG_IFX_CAT1_SPI_DMA
#include <zephyr/drivers/dma.h>
#endif

#include <zephyr/kernel.h>
#include <cy_scb_spi.h>
#include <cy_trigmux.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h>
#include <zephyr/dt-bindings/clock/ifx_clock_source_common.h>
#ifdef CONFIG_IFX_CAT1_SPI_DMA
#include <zephyr/drivers/dma.h>
#endif
#include <zephyr/kernel.h>
#include <cy_scb_spi.h>
#include <cy_trigmux.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h>
#include <zephyr/dt-bindings/clock/ifx_clock_source_common.h>
#include <zephyr/kernel.h>
#ifdef CONFIG_IFX_CAT1_SPI_DMA
#include <zephyr/drivers/dma.h>
#endif
#include <cy_scb_spi.h>
#include <cy_trigmux.h>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

cy_stc_scb_spi_config_t scb_spi_config;

cy_cb_scb_spi_handle_events_t spi_handle_events_func;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cy_stc_scb_spi_config_t scb_spi_config;
cy_cb_scb_spi_handle_events_t spi_handle_events_func;
cy_stc_scb_spi_config_t scb_spi_config;
cy_cb_scb_spi_handle_events_t spi_handle_events_func;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

} else if (channel == data->dma_tx.dma_channel) {

} else {
printk("Unknown\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
printk("Unknown\n");
LOG_ERR("Unknown\n");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

return result;
}

void ifx_cat1_spi_free(const struct device *dev)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void ifx_cat1_spi_free(const struct device *dev)
void spi_free(const struct device *dev)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

irq_disable(config->irq_num);
}

static void ifx_cat1_spi_irq_handler(const struct device *dev)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static void ifx_cat1_spi_irq_handler(const struct device *dev)
static void spi_irq_handler(const struct device *dev)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

return result;
}

static cy_rslt_t ifx_cat1_spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static cy_rslt_t ifx_cat1_spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg)
static cy_rslt_t spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

return result;
}

cy_rslt_t ifx_cat1_spi_set_frequency(const struct device *dev, uint32_t hz)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cy_rslt_t ifx_cat1_spi_set_frequency(const struct device *dev, uint32_t hz)
cy_rslt_t spi_set_frequency(const struct device *dev, uint32_t hz)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change has been implemented.

tbursztyka
tbursztyka previously approved these changes Oct 24, 2025
sreeramIfx
sreeramIfx previously approved these changes Oct 24, 2025
- Updating spi_ifx_cat1_pdl driver to support psc3 and pse84 devices

Signed-off-by: Brett Peterson <[email protected]>
- Adding kit_psc3m5_evk overlay for the spi_loopback test

Signed-off-by: Brett Peterson <[email protected]>
- Adding pse84 overlay files for the spi_loopback test

Signed-off-by: Brett Peterson <[email protected]>
@sonarqubecloud
Copy link

@cfriedt cfriedt merged commit 4301e69 into zephyrproject-rtos:main Oct 25, 2025
28 checks passed
@github-actions
Copy link

Hi @Peterson-Brett!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards/SoCs area: Clock Control area: Devicetree Bindings area: SPI SPI bus area: Tests Issues related to a particular existing or missing test platform: Infineon Infineon Technologies AG

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants